Skip to content

[Fusion] Add support for provides#9588

Merged
michaelstaib merged 4 commits intomainfrom
mst/add-provides
Apr 23, 2026
Merged

[Fusion] Add support for provides#9588
michaelstaib merged 4 commits intomainfrom
mst/add-provides

Conversation

@michaelstaib
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings April 22, 2026 21:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds planner + execution metadata support for @provides in Fusion so the gateway can avoid unnecessary downstream fetches when a subgraph resolver already supplies otherwise-external fields.

Changes:

  • Extend source field metadata to carry IsExternal + Provides selection sets and thread this through schema completion.
  • Update selection-set partitioning to respect @provides scopes (including interface inline-fragment provides) and treat external-only fields as non-resolvable unless covered by provides.
  • Add planner-level and ASP.NET Core integration tests + snapshots for provides scenarios (partial coverage, interface, deeply nested, requires interaction, shareable override, etc.).

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/HotChocolate/Fusion/src/Fusion.Execution/Planning/Partitioners/SelectionSetPartitioner.cs Core planner change: interpret provides scopes (incl. inline fragments), treat external fields correctly, and propagate provides to nested selections.
src/HotChocolate/Fusion/src/Fusion.Execution.Types/Metadata/SourceOutputField.cs Adds IsExternal and Provides metadata to per-subgraph field representation.
src/HotChocolate/Fusion/src/Fusion.Execution.Types/Completion/CompositeSchemaBuilder.cs Populates the new SourceOutputField metadata from parsed directives during schema build.
src/HotChocolate/Core/src/Types/Types/Composite/Types/FieldSelectionSetType.cs Improves selection-set parsing helper to accept either wrapped or unwrapped strings.
src/HotChocolate/Core/src/Types/Types/Composite/Directives/Provides.cs Uses the shared selection-set parsing helper.
src/HotChocolate/Core/src/Types/Types/Composite/Directives/EntityKey.cs Uses the shared selection-set parsing helper.
src/HotChocolate/Core/src/Types/Types/Composite/Directives/EntityKeyDescriptorExtensions.cs Uses the shared selection-set parsing helper.
src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Planning/ProvidesPlannerTests.cs Adds planner-level tests for provides semantics.
src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Planning/snapshots/ProvidesPlannerTests.*.yaml Snapshot baselines for planner provides scenarios.
src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/ProvidesTests.cs Adds integration tests verifying runtime behavior and subgraph interaction patterns.
src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/snapshots/ProvidesTests.*.yaml Snapshot baselines for integration provides scenarios.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants